<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <#assign base=request.contextPath/>
    <#setting  number_format="0.##"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${base}/backstage/layui/css/layui.css" media="all">
    <link href="${base}/sweep/css/mui.css" rel="stylesheet"/>
    <link href="${base}/sweep/css/app.css" rel="stylesheet"/>
    <script src="${base}/backstage/layui/layui.js?t=1"></script>
    <script src="${base}/backstage/js/jquery-1.8.3.min.js?t=1"></script>
    <script src="${base}/backstage/js/feng.js?t=1"></script>
    <script src="${base}/backstage/js/loading.js?t=1"></script>
    <script src="${base}/sweep/js/mui.min.js"></script>
    <style>
        .title {
            margin: 20px 15px 10px;
            color: #6d6d72;
            font-size: 15px;
        }
        .mui-content-padded{
            margin: 10px;
        }

    </style>

</head>
<body>
<input type="hidden" value="${uId}" id="uId"/>
<div class="mui-content" style="margin-bottom: 90px">

    <ul id="OA_task_1" class="mui-table-view">
        <#list planceAnOrders as planceAnOrders>
        <li class="mui-table-view-cell">
            <div class="mui-slider-right mui-disabled">
                <a class="mui-btn mui-btn-red" onclick="deleteSubscript('${planceAnOrders.id}')">删除</a>
            </div>
                <div class="mui-slider-handle">
                    <img class="mui-media-object mui-pull-left" src="${planceAnOrders.url}">
                    <div class="mui-media-body">
                        ${planceAnOrders.goodName}<span style="float: right;color: red">￥${planceAnOrders.commodityPrice}</span>
                        <p class='mui-ellipsis'>${planceAnOrders.describe}</p>

                    </div>
                </div>
        </li>
        </#list>
<#--        <li class="mui-table-view-cell">-->
<#--            <div class="mui-slider-right mui-disabled">-->
<#--                <a class="mui-btn mui-btn-red" onclick="deleteSubscript('1')">删除</a>-->
<#--            </div>-->
<#--            <div class="mui-slider-handle">-->
<#--                <img class="mui-media-object mui-pull-left" src="${base}/backstage/images/touxiang.jpg">-->
<#--                <div class="mui-media-body">-->
<#--                    123<span style="float: right;color: red">￥19</span>-->
<#--                    <p class='mui-ellipsis'>asdasd</p>-->
<#--                </div>-->
<#--            </div>-->
<#--        </li>-->

    </ul>
</div>

<#--<div class="mui-content" style="position: fixed;bottom: 0px;width: 100%;background: none">-->
<#--    <div class="mui-content-padded">-->
<#--        <button type="button" class="mui-btn mui-btn-warning mui-btn-block">提  交</button>-->
<#--    </div>-->
<#--</div>-->
</body>
<script>
    layui.use(['form', 'layedit', 'laydate','layer'], function() {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
    })
    function deleteSubscript(id) {
            $.ajax({
                type: "POST", //提交方式
                data: {"id":id},
                url: "${base}/QRCode/selectByIdJian",//路径
                async:false,
                success: function (data) {//返回数据根据结果进行相应的处理
                    if(data.code==200){
                        layer.msg("添加成功")
                        var index = parent.layer.getFrameIndex(window.name);
                        // parent.layer.close(index);
                        show();
                        parent.sum()
                    }else{
                        layer.msg("添加失败")
                    }
                }
            });
    }


    function show() {
            $.ajax({
                type: "get", //提交方式
                data: {"uId":$("#uId").val()},
                url: "${base}/QRCode/selectGood",//路径
                success: function (data) {//返回数据根据结果进行相应的处理
                    if(data.code==200){
                        $("#OA_task_1").html("")
                        for (let i = 0; i < data.data.length; i++) {
                            $("#OA_task_1").append(
                            '<li class="mui-table-view-cell">'+
                            '<div class="mui-slider-right mui-disabled">'+
                            '<a class="mui-btn mui-btn-red" onclick="deleteSubscript(\''+data.data[i].id+'\')">删除</a>'+
                            '</div>'+
                            '<div class="mui-slider-handle">'+
                            '<img class="mui-media-object mui-pull-left" src="'+data.data[i].url+'">'+
                            '<div class="mui-media-body">'+data.data[i].goodName+''+
                            '<span style="float: right;color: red">￥'+data.data[i].commodityPrice+'</span>'+
                            '<p class="mui-ellipsis">'+data.data[i].describe+'</p>'+
                            '</div>'+
                            '</div>'+
                            '</li>'
                            )
                        }
                    }else{
                        layer.msg("查询失败")
                    }
                }
            });
    }
</script>
</html>